
#ifndef _WEBPAGE_FUNCTION_H_
#define _WEBPAGE_FUNCTION_H_

// Load error code
#define EXCEPTION_LOAD_ERROR      -1
#define DYING_LOAD_ERROR          -2
#define HOSTNOTFOUND_LOAD_ERROR   -3
#define NOTAVALIABLE_LOAD_ERROR   -4
#define CANCEL_LOAD_ERROR         -5
#define PAGELOAD_TIMEOUT_ERROR    -6
#define RAWPAGELOAD_TIMEOUT_ERROR -7
#define NETWORKERROR_LOAD_ERROR   -99


// All webdriver like function index, for other process call.
// WebKit
#define WEBKIT_LONG_CREATE_STRING_USERAGENT 1
#define WEBKIT_LONG_DESTROY_LONG_REF 2
#define WEBKIT_LONG_GET_LONG_REF_STRING_URL 3
#define WEBKIT_BOOL_SETDATABASEENABLED_LONG_REF_BOOL_ENABLE 4
#define WEBKIT_LONG_SETCOOKIE_LONG_REF_STRING_COOKIES_STRING_URL 16
#define WEBKIT_STRING_GETSTATEINFO 58
#define WEBKIT_LONG_CHECK_AVAILABLE 59

// WebPage
#define WEBPAGE_STRING_GETTITLE_LONG_REF 5
#define WEBPAGE_STRING_RENDERTREEDUMP_LONG_REF 6
#define WEBPAGE_STRING_GETPAGESOURCE_LONG_REF 7
#define WEBPAGE_STRING_GETURL_LONG_REF 8
#define WEBPAGE_BOOL_ISJAVASCRIPTENABLED_LONG_REF 9
#define WEBPAGE_VOID_SETJAVASCRIPTENABLED_LONG_REF_BOOL_ENABLE 10
#define WEBPAGE_OBJECT_EVALUATEJS_OBJECT_DRIVER_LONG_REF_OBJECTARRAY_ARGUMENTS 11
#define WEBPAGE_LONG_GETELEMENTBYID_LONG_REF_STRING_QUERY 12
#define WEBPAGE_LONG_SETCOOKIE_LONG_REF_STRING_COOKIES 13
#define WEBPAGE_STRING_COOKIES_LONG_REF 14
#define WEBPAGE_VOID_SETFILTERRULE_STRING_RULES 15
#define WEBPAGE_LONG_DELETECOOKIE_LONG_REF_STRING_CNAME 17
#define WEBPAGE_LONG_GETELEMENTSBYTAGNAME_LONG_REF_STRING_QUERY 18
#define WEBPAGE_LONG_GETELEMENTSBYNAME_LONG_REF_STRING_QUERY 19
#define WEBPAGE_LONG_GETELEMENTSBYXPATH_LONG_REF_STRING_QUERY 20
#define WEBPAGE_LONG_GETELEMENTBYCSSSELECTOR_LONG_REF_STRING_QUERY 21
#define WEBPAGE_LONG_GETELEMENTSBYCSSSELECTOR_LONG_REF_STRING_QUERY 22
#define WEBPAGE_VOID_GOBACK_LONG_REF 30
#define WEBPAGE_VOID_GOFORWARD_LONG_REF 31
#define WEBPAGE_LONG_REFRESH_LONG_REF 32
#define WEBPAGE_LONG_ACTIVEELEMENT 42
#define WEBPAGE_LONG_SELECTFRAMEBYNAME_STRING_NAME 43
#define WEBPAGE_LONG_SELECTFRAMEBYIDX_LONG_IDX 44
#define WEBPAGE_STRING_GETALERTTEXT_LONG_REF_BOOL_CLR 48
#define WEBPAGE_VOID_SETVIEWPORTSIZE_INT_W_INT_H 51
#define WEBPAGE_VOID_LOADURL_LONG_REF_STRING_ADDRESS_STRING_OPERATION_QMAP_STRING_STRING_HEADERS_STRING_BODYSTRING_STRING_ENCODING 55
#define WEBPAGE_VOID_SETHTML_LONG_REF_STRING_HTML 56
#define WEBPAGE_VOID_SETSETTING_LONG_REF_STRING_NAME_STRING_SETTING 57
#define WEBPAGE_STRING_RENDER_IMAGE_BASE64 60
#define WEBPAGE_LONG_SET_DESTROY_TIME 61
#define WEBPAGE_VOID_SCROLL 62
#define WEBPAGE_STRING_GETDOMTREESOURCE_LONG_REF 66
#define WEBPAGE_STRING_POSTDATA_LONG_REF 67
#define WEBPAGE_STRING_METHOD_LONG_REF 68
#define WEBPAGE_LONG_DOWNLOAD_LONG_REF 69
#define WEBPAGE_VOID_MOUSEMOVE_LONG_REF 70
#define WEBPAGE_VOID_MOUSEMOVE_INT_X_INT_Y 71

// Element
#define WEBELEMENT_STRING_GETTAGNAME_LONG_REF 23
#define WEBELEMENT_STRING_GETATTRIBUTE_LONG_REF_STRING_NAME 24
#define WEBELEMENT_STRING_GETPROPERTY_LONG_REF_STRING_NAME 25
#define WEBELEMENT_STRING_GETTEXT_LONG_REF 26
#define WEBELEMENT_STRING_GETVALUE_LONG_REF 27
#define WEBELEMENT_LONG_SENDKEYS_LONG_REF_STRING_TYPE_LONG_KEYS 28
#define WEBELEMENT_LONG_SETVALUE_LONG_REF_STRING_VAL 29
#define WEBELEMENT_LONG_SUBMIT_LONG_REF 33
#define WEBELEMENT_LONG_CLICK_LONG_REF 34
#define WEBELEMENT_LONG_RESET_LONG_REF 35
#define WEBELEMENT_LONG_TOGGLE_LONG_REF 36
#define WEBELEMENT_LONG_FOCUS_LONG_REF 37
#define WEBELEMENT_LONG_SELECTED_LONG_REF 38
#define WEBELEMENT_LONG_SETSELECTED_LONG_REF 39
#define WEBELEMENT_LONG_SELECTOPTIONBYINDEX_LONG_REF 40
#define WEBELEMENT_LONG_STALE_LONG_REF 41
#define WEBELEMENT_BOOL_ISVISIBLE_LONG_REF 45
#define WEBELEMENT_LONG_DRAG_LONG_REF_INT_TOX_INT_TOY_INT_DURATION 46
#define WEBELEMENT_RECT_GETRECT_LONG_REF 47
#define WEBELEMENT_STRING_GETINNERXML_LONG_REF 49
#define WEBELEMENT_STRING_GETOUTERXML_LONG_REF 50
#define WEBELEMENT_LONG_TYPE_LONG_REF_STRING_VAL 52
#define WEBELEMENT_LONG_CHECKED_LONG_REF 53
#define WEBELEMENT_LONG_SETCHECKED_LONG_REF 54
#define WEBELEMENT_VOID_SETATTRIBUTE 63
#define WEBELEMENT_VOID_REMOVEATTRIBUTE 64
#define WEBELEMENT_VOID_GETCHILDSBYCSSSELECTOR 65

#endif

